<script>
import BaseConsumeItem from '../../../consumelist/components/consumemodule/BaseConsumeItem'
export default {
  extends: BaseConsumeItem,
  data() {
    return {
      iconUrl: require('../../assets/bus_card.png')
    }
  },
  mounted() {
    this.setData()
  },
  methods: {
    setData() {
      this.tradeNo = this.data.SNO
      this.title = this.data.TITLE
      this.datetime = this.formatData(this.data.PAY_TIME)
      let state = this.data.PAY_STATUS
      // 除了失败和取消以外的状态图标都展示蓝色
      switch (state) {
        case 0: // 待支付
          this.iconStyle = 'baseBgColorNoActive'
          this.descStyle = 'baseColorNoAcitve'
          this.desc = '待支付'
          break
        case 1: // 成功
          this.iconStyle = 'baseBgColorNoActive'
          this.desc = '- ' + parseFloat(this.data.PAY_PRICE).toFixed(2)
          break
        case 2: // 失败
          this.iconStyle = 'consume-fail-icon'
          this.desc = '支付失败'
          break
        case 3: // 已退款
          this.iconStyle = 'baseBgColorNoActive'
          this.desc = '- ' + parseFloat(this.data.PAY_PRICE).toFixed(2)
          this.refundState = '已退款'
          break
        default:
          break
      }
    }
  }
}
</script>
